package com.socialuni.model.DO.user;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "s_user_token",
        //查询条件索引
        indexes = {
                //关联需要键索引，索引列不能为空
                @Index(columnList = "userId"),
        },
        //手机号唯一
        uniqueConstraints = {
                @UniqueConstraint(columnNames = "token"),
        }
)
@Data
public class SocialUserTokenDO {
    //在talk里面展示的放在user里？
    //必有
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(nullable = false)
    private Integer userId;

    @Column(nullable = false)
    private String token;

    @Column(nullable = false)
    private Date createTime;

    @Column(nullable = false)
    private Date loseTime;
}